-
Notifications
You must be signed in to change notification settings - Fork 699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix project-local flags being ignored #8623
Conversation
cf42086
to
a087092
Compare
I just pushed amendments to this MR that update the remaining tests (along with a rebase), outside PackageTests (isolated changes: bairyn@6446120). |
Thanks for the thoroughness of this PR and tests, for being responsive to the ask to refactor the big PR, and especially for your patience in explaining it in all the details! All very much appreciated. |
I'm approving as is, but it would be great to add a changelog entry to the changelog dir as well. |
a087092
to
e38e2f8
Compare
I noticed that running ‘cabal install’ with two separate sets of dynamic / static build flags (e.g. one with none, and one with ‘--enable-shared --enable-executable-dynamic --disable-library-vanilla’) produced packages with the same hash, instead of different hashes. After debugging this issue I found that this command (with no explicit cabal project file) was resulting in these build configuration flags being ignored, because in ProjectPlanning.hs, the sdist was not considered a local package, so the (non-shared) local-package-only configuration was being dropped. This fix ensures that these command-line arguments properly make it through to where they belong in cases like this. Additionally, adjust the ‘style’ attribute in plan.json so that globally installed packages are designated as global even if they are local to the project. (Without this adjustment to ‘style2str’, the T5782Diamond test fails, because it looks up ‘dist-dirs’ in plan.json, where ‘dist-dirs’ is absent from the JSON.) Finally, take into account elabDynExe and configDynExe to provide GHC with ‘-dynamic’ appropriately rather than going about it with static linking.
e38e2f8
to
2334bcb
Compare
Thanks gbaz. I just updated this MR with the following updates:
|
@bairyn: was that the same failure as on OSX currently? It would be ideal to understand it in both cases. |
2334bcb
to
867cbb9
Compare
No, they're different. I think what happened in the OS X case is that the Grinch stole the vowels from the package names, so when the test looks for ‘basic-0.1-’ to extract the hash (as it's done in UniqueIPID), it can't find it because it isn't looking for ‘bsc-0.1-’. I just pushed an update to the hash extraction utility to also check for ‘bsc-0.1-’, so that the utility in the test works also on OS X. I think what happened in the Windows case is that the installation I set up (with Chocolatey) and the one that the CI server uses don't support dynamic builds. I set up a VM to reproduce the scenario, and I found that just creating a simple ‘cabal init’ application with ‘--enable-shared --enable-executable-dynamic --disable-library-vanilla’ fails with an error since the dynamic files are missing for the ‘base’ package. I updated the note around ‘skipIfWindows’. MR Updates:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot and especially for the test.
Please set one of the merge_me labels and in 2 days it should get auto-merged.
To be clear: I don't think you can have this patch and fix #8719 at the same time. local tarballs should not be affected by flags meant for local packages. The fact There should be a way to explicitly tell that "when you install/build/.. package |
OK, I stand corrected. |
After examining this for a while I'm coming around to the point of view of @phadej A way to see the issue is that I think that even with this PR, I think the change proposed in #8723 is the most straightforward (but I don't understand the comment about it breaking I believe this PR actually packed in another change, which is applying the static and dynamic flags to the setup configs as well, and I think that should stick around. (That was actually the basis on which I had supported this PR to begin with, not realizing it packed in this other thing too!). So that's why I'd propose selective flipping that one line while keeping other refactors (which also seem generally useful), as opposed to a wholesale revert. |
@bairyn: I haven't heard from you and we have to wrap up for the 3.10 (pre-)release. Are you OK with me reverting this PR wholesale on 3.10 and master branches and we can then slowly work our way towards salvaging the clarification and simplification ideas that are contained in it, using the @phadej input? Would that break any of your existing work, e.g., on the other PRs (I hope not, given they compile and test fine on just the bare master branch)? |
This reverts commit b547ead from haskell#8623. Unexpected side-effect has been found, so these code improvements have to be done differently. The other commit in the PR is a test and it's retained.
The (half-)reversion I'd propose is in #8744. |
This reverts commit b547ead from haskell#8623. Unexpected side-effect has been found, so these code improvements have to be done differently. The other commit in the PR is a test and it's retained.
This was originally the first of two parts to the ‘Track static vs. dynamic dependencies.’ pull request (#8461), which I've cleaned up and split into two separate PRs.
This PR fixes an issue in which configuration flags such as ‘--disable-library-vanilla’ could be silently dropped when a package was built and installed, and it also adds a test that sets up a scenario to demonstrate the issue.
(I ran the cabal-testsuite/PackageTests test suite and found ‘432 tests, 6 skipped, 0 unexpected passes, 0 unexpected fails’.)